#!/bin/bash
argNums=$#
if [ $argNums -eq 1 ]
then
    fileName=$1
    rem_mev2=`cat remember-mev2.conf`
    auth_token=`cat cow-auth-token.conf`
    echo $rem_mev2
    echo $auth_token
    ./cowtransfer-uploader -c "remember-mev2=${rem_mev2};" -a "${auth_token}" $fileName
elif [ $argNums -eq 2 ]
then
    fileName=$1
    fileOption=$2
    rem_mev2=`cat remember-mev2.conf`
    auth_token=`cat cow-auth-token.conf`
    echo $rem_mev2
    echo $auth_token
    ./cowtransfer-uploader -c "remember-mev2=${rem_mev2};" -a "${auth_token}" $fileOption $fileName
else
    echo "参数有误"
    echo "使用格式:sh ./uploader.sh {filePath}"
    echo "使用示例:sh ./uploader.sh transfer_0.4.15_linux_amd64.tar.gz"
    echo "上传文件夹"
    echo "使用格式:sh ./uploader.sh {filePath} -s"
    echo "使用示例:sh ./uploader.sh test_dir/ -s"
    echo "=========================="
    echo "奶牛快传网址: https://cowtransfer.com/"
fi
